import request from '@/utils/request'

export default ({
  /**
   * 根据 用户信息 还有航班信息建立订单  返回订单号
   * @param planeId
   * @param planeType
   * @param userId
   * @returns {*}
   */
  createOrder(planeId, planeType) {
    return request({
      url: `/order/pcorderinfo/createBaseOrder/${planeId}/${planeType}`,
      method: 'post'
    })
  },
  getOrderDetail(orderNo) {
    return request({
      url: `/order/pcorderinfo/getOrderInfo/${orderNo}`,
      method: 'get'
    })
  },

  getInformation(orderNo, message) {
    return request({
      url: `order/pcorderinfo/getInformation/${orderNo}`,
      method: 'post',
      data: message,
    })
  },
  paymentOrRefund(order) {
    return request({
      url: `/order/paylog/toPay`,
      method: 'post',
      data: order,
    })
  },
  getMyOrder() {
    return request({
      url: `/order/pcorderinfo/getMyOrder`,
      method: 'get'
    })
  },
  getMyOrder2(current, limit) {
    return request({
      url: `/order/pcorderinfo/getMyOrder2/${current}/${limit}`,
      method: 'post'
    })
  },
  zfb(outTradeNo, subject, totalAmount, body) {
    return request({
      url: `/order/pay/${outTradeNo}/${subject}/${totalAmount}/${body}`,
      method: 'post',
    })
  },
  orderStatus(){
    return request({
      url:'/order/success',
      method:'get'
    })
  },
  writeData(list) {
    return request({
      url: `/excel/Orderdownload`,
      method: 'post',
      data: list,
      responseType: 'blob', // 声明返回blob格式
    })
  },
})
